﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ePlanet.SingleWell.Models;
using ePlanet.Entities;
using ePlanet.ArchiveMange.Models;

namespace Web.Views.DataManage.Models
{

    public class SingleWellEntityHelper
    {
        public static void EntityToRow(SingleWellEntity entity, SingleWellModel.SINGLEWELLRow row)
        {
            try
            {
                row.DATAID = entity.DataId;
                row.WELLCODE = entity.WellCode;
                row.DATAFILENAME = entity.DataFileName;
                row.WORKMODE = entity.WorkMode;
                if (entity.A4 == null)
                {
                    row.SetA4Null();
                }
                else
                {
                    row.A4 = entity.A4.Value;
                }
                if (entity.A3 == null)
                {
                    row.SetA3Null();
                }
                else
                {
                    row.A3 = entity.A3.Value;
                }
                if (entity.A0 == null)
                {
                    row.SetA0Null();
                }
                else
                {
                    row.A0 = entity.A0.Value;
                }
                if (entity.BeginDate == null)
                {
                    row.SetBEGINDATENull();
                }
                else
                {
                    row.BEGINDATE = entity.BeginDate.Value;
                }
                if (entity.FinishDate == null)
                {
                    row.SetFINISHDATENull();
                }
                else
                {
                    row.FINISHDATE = entity.FinishDate.Value;
                }

                row.WELLTYPE = entity.WellType;

                if (entity.BeginWorkDate == null)
                {
                    row.SetBEGINWORKDATENull();
                }
                else
                {
                    row.BEGINWORKDATE = entity.BeginWorkDate.Value;
                }
                if (entity.FinishWorkDate == null)
                {
                    row.SetFINISHWORKDATENull();
                }
                else
                {
                    row.FINISHWORKDATE = entity.FinishWorkDate.Value;
                }
                if (entity.WellDepth == null)
                {
                    row.SetWELLDEPTHNull();
                }
                else
                {
                    row.WELLDEPTH = entity.WellDepth.Value;
                }
                row.ARCHIVECODE = entity.ArchiveCode;
                row.QUANZONGCODE = entity.QuanZongCode;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static SingleWellEntity RowToEntity(SingleWellModel.SINGLEWELLRow row)
        {
            try
            {
                SingleWellEntity entity = new SingleWellEntity();
                entity.DataId = row.DATAID;
                if (!row.IsDATAFILENAMENull())
                {
                    entity.DataFileName = row.DATAFILENAME;
                }
                if (!row.IsWORKMODENull())
                {
                    entity.WorkMode = row.WORKMODE;
                }
                if (!row.IsA4Null())
                {
                    entity.A4 = row.A4;
                }
                if (!row.IsA3Null())
                {
                    entity.A3 = row.A3;
                }
                if (!row.IsA0Null())
                {
                    entity.A0 = row.A0;
                }
                if (!row.IsBEGINDATENull())
                {
                    entity.BeginDate = row.BEGINDATE;
                }
                if (!row.IsFINISHDATENull())
                {
                    entity.FinishDate = row.FINISHDATE;
                }
                entity.WellCode = row.WELLCODE;
                if (!row.IsWELLTYPENull())
                {
                    entity.WellType = row.WELLTYPE;
                }
                if (!row.IsBEGINWORKDATENull())
                {
                    entity.BeginWorkDate = row.BEGINWORKDATE;
                }
                if (!row.IsFINISHWORKDATENull())
                {
                    entity.FinishWorkDate = row.FINISHWORKDATE;
                }
                if (!row.IsWELLDEPTHNull())
                {
                    entity.WellDepth = row.WELLDEPTH;
                }
                if (!row.IsARCHIVECODENull())
                {
                    entity.ArchiveCode = row.ARCHIVECODE;
                }
                if (!row.IsQUANZONGCODENull())
                {
                    entity.QuanZongCode = row.QUANZONGCODE;
                }
                return entity;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }

    public class CdArchiveEntityHelper
    {
        public static void EntityToRow(CdArchiveEntity entity, ArchiveMangeModal.CD_ARCHIVERow row)
        {
            try
            {
                row.DATAID = entity.DataId;
                row.ARCHIVENUM = entity.ArchiveNum;
                row.TEMPORDERNUM = entity.TempOrderNum;
                row.ARCHIVESOURCE = entity.ArchiveSource;
                row.FULLFONDSNUM = entity.FullFondsNum;
                row.TITLE = entity.Title;
                if (entity.ArchiveType.HasValue)
                {
                    row.ARCHIVETYPE = entity.ArchiveType.Value;
                }
                else
                {
                    row.SetARCHIVETYPENull();
                }
                row.PUBLISHER = entity.Publisher;
                if (entity.PublishTime.HasValue)
                {
                    row.PUBLISHTIME = entity.PublishTime.Value;
                }
                else
                {
                    row.SetPUBLISHTIMENull();
                }
                row.FILEORGID = row.FILEORGID;
                row.F_KEEPTIME = entity.F_KeepTime;
                row.F_CARRIERTYPE = entity.F_CarrierType;
                row.F_SECURITYTYPE = entity.F_SecurityType;
                row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;
                if (entity.MainBodyNum.HasValue)
                {
                    row.MAINBODYNUM = entity.MainBodyNum.Value;
                }
                else
                {
                    row.SetMAINBODYNUMNull();
                }
                row.SUMMARY = entity.Summary;
                row.STORAGETYPE = entity.StorageType;
                row.FILENUM = entity.FileNum;
                row.BOXNUM = entity.BoxNum;
                row.EXPANSIONINFO = entity.ExpansionInfo;

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static CdArchiveEntity RowToEntity(ArchiveMangeModal.CD_ARCHIVERow row)
        {
            try
            {
                CdArchiveEntity entity = new CdArchiveEntity();
                entity.DataId = row.DATAID;
                entity.ArchiveNum = row.ARCHIVENUM;
                entity.TempOrderNum = row.TEMPORDERNUM;
                entity.ArchiveSource = row.ARCHIVESOURCE;
                entity.FullFondsNum = row.FULLFONDSNUM;
                entity.Title = row.TITLE;
                if (!row.IsARCHIVETYPENull())
                {
                    entity.ArchiveType = row.ARCHIVETYPE;
                }
                entity.Publisher = row.PUBLISHER;
                if (!row.IsPUBLISHTIMENull())
                {
                    entity.PublishTime = row.PUBLISHTIME;
                }
                entity.FileOrgId = row.FILEORGID;
                entity.F_KeepTime = row.F_KEEPTIME;
                entity.F_CarrierType = row.F_CARRIERTYPE;
                entity.F_SecurityType = row.F_SECURITYTYPE;
                entity.F_KeepSecurityTime = row.F_KEEPSECURITYTIME;
                if (!row.IsMAINBODYNUMNull())
                {
                    entity.MainBodyNum = row.MAINBODYNUM;
                }
                entity.Summary = row.SUMMARY;
                entity.StorageType = row.STORAGETYPE;
                entity.FileNum = row.FILENUM;
                entity.BoxNum = row.BOXNUM;
                entity.ExpansionInfo = row.EXPANSIONINFO;
                return entity;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }

    public class DocumentArchiveEntityHelper
    {
        public static void EntityToRow(DocumentArchiveEntity entity, ArchiveMangeModal.DOCUMENT_ARCHIVERow row)
        {
            try
            {
                row.DATAID = entity.DataId;
                row.ARCHIVENUM = entity.ArchiveNum;
                row.TEMPORDERNUM = entity.TempOrderNum;
                row.ARCHIVESOURCE = entity.ArchiveSource;
                row.FULLFONDSNUM = entity.FullFondsNum;
                row.TITLE = entity.Title;
                if (entity.ArchiveType.HasValue)
                {
                    row.ARCHIVETYPE = entity.ArchiveType.Value;
                }
                else
                {
                    row.SetARCHIVETYPENull();
                }
                row.FILEORGID = entity.FileOrgId;
                row.PUBLISHER = entity.Publisher;
                if (entity.PublishTime.HasValue)
                {
                    row.PUBLISHTIME = entity.PublishTime.Value;
                }
                else
                {
                    row.SetPUBLISHTIMENull();
                }
                row.FILEORGID = row.FILEORGID;
                row.F_KEEPTIME = entity.F_KeepTime;
                row.F_CARRIERTYPE = entity.F_CarrierType;
                row.F_SECURITYTYPE = entity.F_SecurityType;
                row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;
                if (entity.PageNum.HasValue)
                {
                    row.PAGENUM = entity.PageNum.Value;
                }
                else
                {
                    row.SetPAGENUMNull();
                }
                if (entity.MainBodyNum.HasValue)
                {
                    row.MAINBODYNUM = entity.MainBodyNum.Value;
                }
                else
                {
                    row.SetMAINBODYNUMNull();
                }
                if (entity.DoplicateBodyNum.HasValue)
                {
                    row.DOPLICATEBODYNUM = entity.DoplicateBodyNum.Value;
                }
                else
                {
                    row.SetDOPLICATEBODYNUMNull();
                }
                row.SUMMARY = entity.Summary;
                row.REMARK = entity.Remark;
                row.STORAGETYPE = entity.StorageType;
                row.FILENUM = entity.FileNum;
                row.BOXNUM = entity.BoxNum;
                row.EXPANSIONINFO = entity.ExpansionInfo;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static DocumentArchiveEntity RowToEntity(ArchiveMangeModal.DOCUMENT_ARCHIVERow row)
        {
            try
            {
                DocumentArchiveEntity entity = new DocumentArchiveEntity();
                entity.DataId = row.DATAID;
                entity.ArchiveNum = row.ARCHIVENUM;
                entity.TempOrderNum = row.TEMPORDERNUM;
                entity.ArchiveSource = row.ARCHIVESOURCE;
                entity.FullFondsNum = row.FULLFONDSNUM;
                entity.Title = row.TITLE;
                if (!row.IsARCHIVETYPENull())
                {
                    entity.ArchiveType = row.ARCHIVETYPE;
                }
                entity.Publisher = row.PUBLISHER;
                if (!row.IsPUBLISHTIMENull())
                {
                    entity.PublishTime = row.PUBLISHTIME;
                }
                entity.FileOrgId = row.FILEORGID;
                entity.F_KeepTime = row.F_KEEPTIME;
                entity.F_CarrierType = row.F_CARRIERTYPE;
                entity.F_SecurityType = row.F_SECURITYTYPE;
                entity.F_KeepSecurityTime = row.F_KEEPSECURITYTIME;
                if (!row.IsPAGENUMNull())
                {
                    entity.PageNum = row.PAGENUM;
                }
                if (!row.IsMAINBODYNUMNull())
                {
                    entity.MainBodyNum = row.MAINBODYNUM;
                }
                if (!row.IsDOPLICATEBODYNUMNull())
                {
                    entity.DoplicateBodyNum = row.DOPLICATEBODYNUM;
                }
                entity.Summary = row.SUMMARY;
                entity.Remark = row.REMARK;
                entity.StorageType = row.STORAGETYPE;
                entity.FileNum = row.FILENUM;
                entity.BoxNum = row.BOXNUM;
                entity.ExpansionInfo = row.EXPANSIONINFO;
                return entity;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }

    public class RealKindArchiveEntityHelper
    {
        public static void EntityToRow(RealKindArchiveEntity entity, ArchiveMangeModal.REALKIND_ARCHIVERow row)
        {
            try
            {
                row.DATAID = entity.DataId;
                row.ARCHIVENUM = entity.ArchiveNum;
                row.TEMPORDERNUM = entity.TempOrderNum;
                row.ARCHIVESOURCE = entity.ArchiveSource;
                row.FULLFONDSNUM = entity.FullFondsNum;
                row.TITLE = entity.Title;
                if (entity.ArchiveType.HasValue)
                {
                    row.ARCHIVETYPE = entity.ArchiveType.Value;
                }
                else
                {
                    row.SetARCHIVETYPENull();
                }
                row.PUBLISHORGID = entity.PublishOrgId;
                row.PUBLISHER = entity.Publisher;
                if (entity.PublishTime.HasValue)
                {
                    row.PUBLISHTIME = entity.PublishTime.Value;
                }
                else
                {
                    row.SetPUBLISHTIMENull();
                }
                row.FILEORGID = entity.FileOrgId;
                row.F_KEEPTIME = entity.F_KeepTime;
                row.F_CARRIERTYPE = entity.F_CarrierType;
                row.F_SECURITYTYPE = entity.F_SecurityType;
                row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;
                row.GLORYTYPE = entity.GloryType;
                if (entity.MainBodyNum.HasValue)
                {
                    row.MAINBODYNUM = entity.MainBodyNum.Value;
                }
                else
                {
                    row.SetMAINBODYNUMNull();
                }
                row.SUMMARY = entity.Summary;
                row.STORAGETYPE = entity.StorageType;
                row.FILENUM = entity.FileNum;
                row.BOXNUM = entity.BoxNum;
                row.EXPANSIONINFO = entity.ExpansionInfo;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static RealKindArchiveEntity RowToEntity(ArchiveMangeModal.REALKIND_ARCHIVERow row)
        {
            try
            {
                RealKindArchiveEntity entity = new RealKindArchiveEntity();
                entity.DataId = row.DATAID;
                entity.ArchiveNum = row.ARCHIVENUM;
                entity.TempOrderNum = row.TEMPORDERNUM;
                entity.ArchiveSource = row.ARCHIVESOURCE;
                entity.FullFondsNum = row.FULLFONDSNUM;
                entity.Title = row.TITLE;
                if (!row.IsARCHIVETYPENull())
                {
                    entity.ArchiveType = row.ARCHIVETYPE;
                }
                entity.PublishOrgId = row.PUBLISHORGID;
                entity.Publisher = row.PUBLISHER;
                if (!row.IsPUBLISHTIMENull())
                {
                    entity.PublishTime = row.PUBLISHTIME;
                }
                entity.FileOrgId = row.FILEORGID;
                entity.F_KeepTime = row.F_KEEPTIME;
                entity.F_CarrierType = row.F_CARRIERTYPE;
                entity.F_SecurityType = row.F_SECURITYTYPE;
                entity.F_KeepSecurityTime = row.F_KEEPSECURITYTIME;
                entity.GloryType = row.GLORYTYPE;
                if (!row.IsMAINBODYNUMNull())
                {
                    entity.MainBodyNum = row.MAINBODYNUM;
                }
                entity.Summary = row.SUMMARY;
                entity.StorageType = row.STORAGETYPE;
                entity.FileNum = row.FILENUM;
                entity.BoxNum = row.BOXNUM;
                entity.ExpansionInfo = row.EXPANSIONINFO;
                return entity;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }

    public class TechnologyArchiveEntityHelper
    {
        public static void EntityToRow(TechnologyArchiveEntity entity, ArchiveMangeModal.TECHNOLOGY_ARCHIVERow row)
        {
            try
            {
                row.DATAID = entity.DataId;
                row.ARCHIVENUM = entity.ArchiveNum;
                row.TEMPORDERNUM = entity.TempOrderNum;
                row.ARCHIVESOURCE = entity.ArchiveSource;
                row.FULLFONDSNUM = entity.FullFondsNum;
                row.TITLE = entity.Title;
                if (entity.ArchiveType.HasValue)
                {
                    row.ARCHIVETYPE = entity.ArchiveType.Value;
                }
                else
                {
                    row.SetARCHIVETYPENull();
                }
                row.PUBLISHORGID = entity.PublishOrgId;
                row.PUBLISHER = entity.Publisher;
                if (entity.StartTime.HasValue)
                {
                    row.STARTTIME = entity.StartTime.Value;
                }
                else
                {
                    row.SetSTARTTIMENull();
                }
                if (entity.EndTime.HasValue)
                {
                    row.ENDTIME = entity.EndTime.Value;
                }
                else
                {
                    row.SetENDTIMENull();
                }
                row.ACHIVELEVEL = entity.AchiveLevel;
                row.FILEORGID = entity.FileOrgId;
                row.F_KEEPTIME = entity.F_KeepTime;
                row.F_CARRIERTYPE = entity.F_CarrierType;
                row.F_SECURITYTYPE = entity.F_SecurityType;
                row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;
                if (entity.PageNum.HasValue)
                {
                    row.PAGENUM = entity.PageNum.Value;
                }
                else
                {
                    row.SetPAGENUMNull();
                }
                if (entity.PageFileNum.HasValue)
                {
                    row.PAGEFILENUM = entity.PageFileNum.Value;
                }
                else
                {
                    row.SetPAGEFILENUMNull();
                }
                if (entity.MainBodyNum.HasValue)
                {
                    row.MAINBODYNUM = entity.MainBodyNum.Value;
                }
                else
                {
                    row.SetMAINBODYNUMNull();
                }
                row.HUJIANHAO = entity.HuJianHao;
                row.SUMMARY = entity.Summary;
                row.REMARK = entity.Remark;
                row.STORAGETYPE = entity.StorageType;
                row.BOXNUM = entity.BoxNum;
                row.EXPANSIONINFO = entity.ExpansionInfo;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static TechnologyArchiveEntity RowToEntity(ArchiveMangeModal.TECHNOLOGY_ARCHIVERow row)
        {
            try
            {
                TechnologyArchiveEntity entity = new TechnologyArchiveEntity();
                entity.DataId = row.DATAID;
                entity.ArchiveNum = row.ARCHIVENUM;
                entity.TempOrderNum = row.TEMPORDERNUM;
                entity.ArchiveSource = row.ARCHIVESOURCE;
                entity.FullFondsNum = row.FULLFONDSNUM;
                entity.Title = row.TITLE;
                if (!row.IsARCHIVETYPENull())
                {
                    entity.ArchiveType = row.ARCHIVETYPE;
                }
                entity.PublishOrgId = row.PUBLISHORGID;
                entity.Publisher = row.PUBLISHER;
                if (!row.IsSTARTTIMENull())
                {
                    entity.StartTime = row.STARTTIME;
                }
                if (!row.IsENDTIMENull())
                {
                    entity.EndTime = row.ENDTIME;
                }
                if (entity.EndTime.HasValue)
                {
                    row.ENDTIME = entity.EndTime.Value;
                }
                else
                {
                    row.SetENDTIMENull();
                }
                entity.AchiveLevel = row.ACHIVELEVEL;
                row.FILEORGID = row.FILEORGID;
                entity.F_KeepTime = row.F_KEEPTIME;
                entity.F_CarrierType = row.F_CARRIERTYPE;
                entity.F_SecurityType = row.F_SECURITYTYPE;
                row.F_KEEPSECURITYTIME = row.F_KEEPSECURITYTIME;
                if (row.IsPAGENUMNull())
                {
                    entity.PageNum = row.PAGENUM;
                }
                if (!row.IsPAGEFILENUMNull())
                {
                    entity.PageFileNum = row.PAGEFILENUM;
                }
                if (!row.IsMAINBODYNUMNull())
                {
                    entity.MainBodyNum = row.MAINBODYNUM;
                }
                entity.HuJianHao = row.HUJIANHAO;
                entity.Summary = row.SUMMARY;
                entity.Remark = row.REMARK;
                entity.StorageType = row.STORAGETYPE;
                entity.BoxNum = row.BOXNUM;
                entity.ExpansionInfo = row.EXPANSIONINFO;
                return entity;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }

    public class AccountVoucherArchiveEntityHelper
    {
        public static void EntityToRow(AccountVoucherArchiveEntity entity, ArchiveMangeModal.ACCOUNT_VOUCHER_ARCHIVERow row)
        {
            try
            {
                row.DATAID = entity.DataId;
                row.ARCHIVENUM = entity.ArchiveNum;
                row.TEMPORDERNUM = entity.TempOrderNum;
                row.ARCHIVESOURCE = entity.ArchiveSource;
                row.FULLFONDSNUM = entity.FullFondsNum;
                row.TITLE = entity.Title;
                if (entity.ArchiveType.HasValue)
                {
                    row.ARCHIVETYPE = entity.ArchiveType.Value;
                }
                else
                {
                    row.SetARCHIVETYPENull();
                }
                row.F_KEEPTIME = entity.F_KeepTime;
                row.F_CARRIERTYPE = entity.F_CarrierType;
                row.F_SECURITYTYPE = entity.F_SecurityType;
                row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;
                if (entity.StartTime.HasValue)
                {
                    row.STARTTIME = entity.StartTime.Value;
                }
                else
                {
                    row.SetSTARTTIMENull();
                }
                if (entity.EndTime.HasValue)
                {
                    row.ENDTIME = entity.EndTime.Value;
                }
                else
                {
                    row.SetENDTIMENull();
                }
                if (entity.K_Year.HasValue)
                {
                    row.K_YEAR = Convert.ToInt32(entity.K_Year.Value);
                }
                else
                {
                    row.SetK_YEARNull();
                }
                if (entity.PageNum.HasValue)
                {
                    row.PAGENUM = entity.PageNum.Value;
                }
                else
                {
                    row.SetPAGENUMNull();
                }
                row.STARTACCOUNT = entity.StartAccount;
                row.ENDACCOUNT = entity.EndAccount;
                row.SUMMARY = entity.Summary;
                row.STORAGETYPE = entity.StorageType;
                if (entity.PageFileNum.HasValue)
                {
                    row.PAGEFILENUM = entity.PageFileNum.Value;
                }
                else
                {
                    row.SetPAGEFILENUMNull();
                }
                row.BOXNUM = entity.BoxNum;
                row.EXPANSIONINFO = entity.ExpansionInfo;
                row.ACCOUNTTYPE = entity.AccountType;
                row.FILEORGID = entity.FileOrgId;
                if (entity.MainBodyNum.HasValue)
                {
                    row.MAINBODYNUM = entity.MainBodyNum.Value;
                }
                else
                {
                    row.SetMAINBODYNUMNull();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static AccountVoucherArchiveEntity RowToEntity(ArchiveMangeModal.ACCOUNT_VOUCHER_ARCHIVERow row)
        {
            try
            {
                AccountVoucherArchiveEntity entity = new AccountVoucherArchiveEntity();
                entity.DataId = row.DATAID;
                entity.ArchiveNum = row.ARCHIVENUM;
                entity.TempOrderNum = row.TEMPORDERNUM;
                entity.ArchiveSource = row.ARCHIVESOURCE;
                entity.FullFondsNum = row.FULLFONDSNUM;
                entity.Title = row.TITLE;
                if (!row.IsARCHIVETYPENull())
                {
                    entity.ArchiveType = row.ARCHIVETYPE;
                }
                entity.F_KeepTime = row.F_KEEPTIME;
                entity.F_CarrierType = row.F_CARRIERTYPE;
                entity.F_SecurityType = row.F_SECURITYTYPE;
                entity.F_KeepSecurityTime = row.F_KEEPSECURITYTIME;
                if (!row.IsSTARTTIMENull())
                {
                    entity.StartTime = row.STARTTIME;
                }
                if (!row.IsENDTIMENull())
                {
                    entity.EndTime = row.ENDTIME;
                }
                if (!row.IsK_YEARNull())
                {
                    entity.K_Year = row.K_YEAR;
                }
                if (!row.IsPAGENUMNull())
                {
                    entity.PageNum = row.PAGENUM;
                }
                entity.StartAccount = row.STARTACCOUNT;
                entity.EndAccount = row.ENDACCOUNT;
                entity.Summary = row.SUMMARY;
                entity.StorageType = row.STORAGETYPE;
                if (!row.IsPAGEFILENUMNull())
                {
                    entity.PageFileNum = row.PAGEFILENUM;
                }
                entity.BoxNum = row.BOXNUM;
                entity.ExpansionInfo = row.EXPANSIONINFO;
                entity.AccountType = row.ACCOUNTTYPE;
                entity.FileOrgId = row.FILEORGID;
                if (!row.IsMAINBODYNUMNull())
                {
                    entity.MainBodyNum = row.MAINBODYNUM;
                }
                return entity;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }

    public class BulidProjectArchiveEntityHelper
    {
        public static void EntityToRow(BulidProjectArchiveEntity entity, ArchiveMangeModal.BULIDPROJECT_ARCHIVERow row)
        {
            try
            {
                row.DATAID = entity.DataId;
                row.ARCHIVENUM = entity.ArchiveNum;
                row.TEMPORDERNUM = entity.TempOrderNum;
                row.ARCHIVESOURCE = entity.ArchiveSource;
                row.FULLFONDSNUM = entity.FullFondsNum;
                row.TITLE = entity.Title;
                if (entity.ArchiveType.HasValue)
                {
                    row.ARCHIVETYPE = entity.ArchiveType.Value;
                }
                else
                {
                    row.SetARCHIVETYPENull();
                }
                row.PUBLISHORGID = entity.PublishOrgId;
                row.PUBLISHORGID = entity.PublishOrgId;
                if (entity.PublishTime.HasValue)
                {
                    row.PUBLISHTIME = entity.PublishTime.Value;
                }
                else
                {
                    row.SetPUBLISHTIMENull();
                }
                if (entity.StartTime.HasValue)
                {
                    row.STARTTIME = entity.StartTime.Value;
                }
                else
                {
                    row.SetSTARTTIMENull();
                }
                if (entity.EndTime.HasValue)
                {
                    row.ENDTIME = entity.EndTime.Value;
                }
                else
                {
                    row.SetENDTIMENull();
                }
                row.FILEORGID = entity.FileOrgId;
                row.F_KEEPTIME = entity.F_KeepTime;
                row.F_CARRIERTYPE = entity.F_CarrierType;
                row.F_SECURITYTYPE = entity.F_SecurityType;
                row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;
                if (entity.PageNum.HasValue)
                {
                    row.PAGENUM = entity.PageNum.Value;
                }
                else
                {
                    row.SetPAGENUMNull();
                }
                if (entity.PageFileNum.HasValue)
                {
                    row.PAGEFILENUM = entity.PageFileNum.Value;
                }
                else
                {
                    row.SetPAGEFILENUMNull();
                }
                if (entity.MainBodyNum.HasValue)
                {
                    row.MAINBODYNUM = entity.MainBodyNum.Value;
                }
                else
                {
                    row.SetMAINBODYNUMNull();
                }
                row.SUMMARY = entity.Summary;
                row.REMARK = entity.Remark;
                row.HUJIANHAO = entity.HuJianHao;
                row.STORAGETYPE = entity.StorageType;
                row.FILENUM = entity.FileNum;
                row.BOXNUM = entity.BoxNum;
                row.EXPANSIONINFO = entity.ExpansionInfo;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static BulidProjectArchiveEntity RowToEntity(ArchiveMangeModal.BULIDPROJECT_ARCHIVERow row)
        {
            try
            {
                BulidProjectArchiveEntity entity = new BulidProjectArchiveEntity();
                entity.DataId = row.DATAID;
                entity.ArchiveNum = row.ARCHIVENUM;
                entity.TempOrderNum = row.TEMPORDERNUM;
                entity.ArchiveSource = row.ARCHIVESOURCE;
                entity.FullFondsNum = row.FULLFONDSNUM;
                entity.Title = row.TITLE;
                if (!row.IsARCHIVETYPENull())
                {
                    entity.ArchiveType = row.ARCHIVETYPE;
                }
                entity.PublishOrgId = row.PUBLISHORGID;
                if (!row.IsPUBLISHTIMENull())
                {
                    entity.PublishTime = row.PUBLISHTIME;
                }
                entity.PublishOrgId = row.PUBLISHORGID;
                if (!row.IsSTARTTIMENull())
                {
                    entity.StartTime = row.STARTTIME;
                }
                if (!row.IsENDTIMENull())
                {
                    entity.EndTime = row.ENDTIME;
                }
                entity.FileOrgId = row.FILEORGID;
                entity.F_KeepTime = row.F_KEEPTIME;
                entity.F_CarrierType = row.F_CARRIERTYPE;
                entity.F_SecurityType = row.F_SECURITYTYPE;
                entity.F_KeepSecurityTime = row.F_KEEPSECURITYTIME;
                if (!row.IsMAINBODYNUMNull())
                {
                    entity.MainBodyNum = row.MAINBODYNUM;
                }
                if (!row.IsPAGENUMNull())
                {
                    entity.PageNum = row.PAGENUM;
                }
                if (!row.IsPAGEFILENUMNull())
                {
                    entity.PageFileNum = row.PAGEFILENUM;
                }
                entity.Summary = row.SUMMARY;
                entity.Remark = row.REMARK;
                entity.HuJianHao = row.HUJIANHAO;
                entity.StorageType = row.STORAGETYPE;
                entity.FileNum = row.FILENUM;
                entity.BoxNum = row.BOXNUM;
                entity.ExpansionInfo = row.EXPANSIONINFO;
                return entity;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }

    public class AudioVedioArchiveEntityHelper
    {
        public static void EntityToRow(AudioVedioArchiveEntity entity, ArchiveMangeModal.AUDIOVEDIO_ARCHIVERow row)
        {
            try
            {
                row.DATAID = entity.DataId;
                row.ARCHIVENUM = entity.ArchiveNum;
                row.TEMPORDERNUM = entity.TempOrderNum;
                row.ARCHIVESOURCE = entity.ArchiveSource;
                row.FULLFONDSNUM = entity.FullFondsNum;
                row.TITLE = entity.Title;
                if (entity.ArchiveType.HasValue)
                {
                    row.ARCHIVETYPE = entity.ArchiveType.Value;
                }
                else
                {
                    row.SetARCHIVETYPENull();
                }
                row.PUBLISHORGID = entity.PublishOrgId;
                row.PUBLISHER = entity.Publisher;
                if (entity.PublishTime.HasValue)
                {
                    row.PUBLISHTIME = entity.PublishTime.Value;
                }
                else
                {
                    row.SetPUBLISHTIMENull();
                }
                row.FILEORGID = entity.FileOrgId;
                row.F_KEEPTIME = entity.F_KeepTime;
                row.F_CARRIERTYPE = entity.F_CarrierType;
                row.F_SECURITYTYPE = entity.F_SecurityType;
                row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;
                if (entity.PageNum.HasValue)
                {
                    row.PAGENUM = entity.PageNum.Value;
                }
                else
                {
                    row.SetPAGENUMNull();
                }
                if (entity.MainBodyNum.HasValue)
                {
                    row.MAINBODYNUM = entity.MainBodyNum.Value;
                }
                else
                {
                    row.SetMAINBODYNUMNull();
                }
                row.REMARK = entity.Remark;
                row.HUJIANHAO = entity.HuJianHao;
                row.STORAGETYPE = entity.StorageType;
                row.FILENUM = entity.FileNum;
                row.BOXNUM = entity.BoxNum;
                row.EXPANSIONINFO = entity.ExpansionInfo;
                row.SUMMARY = entity.Summary;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static AudioVedioArchiveEntity RowToEntity(ArchiveMangeModal.AUDIOVEDIO_ARCHIVERow row)
        {
            try
            {
                AudioVedioArchiveEntity entity = new AudioVedioArchiveEntity();
                entity.DataId = row.DATAID;
                entity.ArchiveNum = row.ARCHIVENUM;
                entity.TempOrderNum = row.TEMPORDERNUM;
                entity.ArchiveSource = row.ARCHIVESOURCE;
                entity.FullFondsNum = row.FULLFONDSNUM;
                entity.Title = row.TITLE;
                if (!row.IsARCHIVETYPENull())
                {
                    entity.ArchiveType = row.ARCHIVETYPE;
                }
                entity.PublishOrgId = row.PUBLISHORGID;
                entity.Publisher = row.PUBLISHER;
                if (!row.IsPUBLISHTIMENull())
                {
                    entity.PublishTime = row.PUBLISHTIME;
                }
                entity.FileOrgId = row.FILEORGID;
                entity.F_KeepTime = row.F_KEEPTIME;
                entity.F_CarrierType = row.F_CARRIERTYPE;
                entity.F_SecurityType = row.F_SECURITYTYPE;
                entity.F_KeepSecurityTime = row.F_KEEPSECURITYTIME;
                if (!row.IsPAGENUMNull())
                {
                    entity.PageNum = row.PAGENUM;
                } if (!row.IsMAINBODYNUMNull())
                {
                    entity.MainBodyNum = row.MAINBODYNUM;
                }
                entity.Remark = row.REMARK;
                entity.HuJianHao = row.HUJIANHAO;
                entity.StorageType = row.STORAGETYPE;
                entity.FileNum = row.FILENUM;
                entity.BoxNum = row.BOXNUM;
                entity.ExpansionInfo = row.EXPANSIONINFO;
                return entity;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }

    public class OliSearchArchiveEntityHelper
    {
        public static void EntityToRow(OliSearchArchiveEntity entity, ArchiveMangeModal.OLISEARCH_ARCHIVERow row)
        {
            try
            {
                row.DATAID = entity.DataId;
                row.ARCHIVENUM = entity.ArchiveNum;
                row.TEMPORDERNUM = entity.TempOrderNum;
                row.ARCHIVESOURCE = entity.ArchiveSource;
                row.FULLFONDSNUM = entity.FullFondsNum;
                row.TITLE = entity.Title;
                if (entity.ArchiveType.HasValue)
                {
                    row.ARCHIVETYPE = entity.ArchiveType.Value;
                }
                else
                {
                    row.SetARCHIVETYPENull();
                }
                row.PUBLISHORGID = entity.PublishOrgId;
                row.PUBLISHER = entity.Publisher;
                if (entity.PublishTime.HasValue)
                {
                    row.PUBLISHTIME = entity.PublishTime.Value;
                }
                else
                {
                    row.SetPUBLISHTIMENull();
                }
                row.FILEORGID = entity.FileOrgid;
                row.F_KEEPTIME = entity.F_KeepTime;
                row.F_CARRIERTYPE = entity.F_CarrierType;
                row.F_SECURITYTYPE = entity.F_SecurityType;
                row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;
                if (entity.PageNum.HasValue)
                {
                    row.PAGENUM = entity.PageNum.Value;
                }
                else
                {
                    row.SetPAGENUMNull();
                }
                if (entity.MainBodyNum.HasValue)
                {
                    row.MAINBODYNUM = entity.MainBodyNum.Value;
                }
                else
                {
                    row.SetMAINBODYNUMNull();
                }
                if (entity.DoplicateBodyNum.HasValue)
                {
                    row.DOPLICATEBODYNUM = entity.DoplicateBodyNum.Value;
                }
                else
                {
                    row.SetDOPLICATEBODYNUMNull();
                }
                row.WELLNUMBER = entity.WellNumber;
                row.WELLADDRESS = entity.WellAddress;
                row.WELLTYPE = entity.WellType;
                row.SUMMARY = entity.Summary;
                row.REMARK = entity.Remark;
                row.HUJIANHAO = entity.HuJianHao;
                row.STORAGETYPE = entity.StorageType;
                row.FILENUM = entity.FileNum;
                row.BOXNUM = entity.BoxNum;
                row.EXPANSIONINFO = entity.ExpansionInfo;
                //新增列
                row.F_CATAGORYTYPE = entity.CatagoryType;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static OliSearchArchiveEntity RowToEntity(ArchiveMangeModal.OLISEARCH_ARCHIVERow row)
        {
            try
            {
                OliSearchArchiveEntity entity = new OliSearchArchiveEntity();
                entity.DataId = row.DATAID;
                entity.ArchiveNum = row.ARCHIVENUM;
                entity.TempOrderNum = row.TEMPORDERNUM;
                entity.ArchiveSource = row.ARCHIVESOURCE;
                entity.FullFondsNum = row.FULLFONDSNUM;
                entity.Title = row.TITLE;
                if (!row.IsARCHIVETYPENull())
                {
                    entity.ArchiveType = row.ARCHIVETYPE;
                }
                entity.PublishOrgId = row.PUBLISHORGID;
                entity.Publisher = row.PUBLISHER;
                if (!row.IsPUBLISHTIMENull())
                {
                    entity.PublishTime = row.PUBLISHTIME;
                }
                entity.FileOrgid = row.FILEORGID;
                entity.F_KeepTime = row.F_KEEPTIME;
                entity.F_CarrierType = row.F_CARRIERTYPE;
                entity.F_SecurityType = row.F_SECURITYTYPE;
                entity.F_KeepSecurityTime = row.F_KEEPSECURITYTIME;
                if (!row.IsPAGENUMNull())
                {
                    entity.PageNum = row.PAGENUM;
                }
                if (!row.IsMAINBODYNUMNull())
                {
                    entity.MainBodyNum = row.MAINBODYNUM;
                }
                if (!row.IsDOPLICATEBODYNUMNull())
                {
                    entity.DoplicateBodyNum = row.DOPLICATEBODYNUM;
                }
                entity.WellNumber = row.WELLNUMBER;
                entity.WellAddress = row.WELLADDRESS;
                entity.WellType = row.WELLTYPE;
                entity.Summary = row.SUMMARY;
                entity.Remark = row.REMARK;
                entity.HuJianHao = row.HUJIANHAO;
                entity.StorageType = row.STORAGETYPE;
                entity.FileNum = row.FILENUM;
                entity.BoxNum = row.BOXNUM;
                entity.ExpansionInfo = row.EXPANSIONINFO;
                return entity;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }

    public class PageFileEntityHelper
    {
        public static void EntityToRow(PageFileEntity entity, ArchiveMangeModal.PAGEFILERow row)
        {
            try
            {
                row.DATAID = entity.DataId;
                row.F_ARCHIVEID = entity.F_ArchiveId;
                row.ARCHIVENUM = entity.ArchiveNum;
                row.TEMPORDERNUM = entity.TempOrderNum;
                row.ARCHIVESOURCE = entity.ArchiveSource;
                row.FULLFONDSNUM = entity.FullFondsNum;
                row.TITLE = entity.Title;
                if (entity.ArchiveType.HasValue)
                {
                    row.ARCHIVETYPE = entity.ArchiveType.Value;
                }
                else
                {
                    row.SetARCHIVETYPENull();
                }
                row.PUBLISHER = entity.Publisher;
                if (entity.PublishTime.HasValue)
                {
                    row.PUBLISHTIME = entity.PublishTime.Value;
                }
                else
                {
                    row.SetPUBLISHTIMENull();
                }
                row.FILEORGID = entity.FileOrgId;
                row.F_KEEPTIME = entity.F_KeepTime;
                row.F_CARRIERTYPE = entity.F_CarrierType;
                row.F_SECURITYTYPE = entity.F_SecurityType;
                row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;

                row.PAGENUM = entity.PageNum;

                row.HUJIANHAO = entity.HuJianHao;
                row.BOXNUM = entity.BoxNum;
                row.EXPANSIONINFO = entity.ExpansionInfo;
                if (entity.OrderNum.HasValue)
                {
                    row.ORDERNUM = entity.OrderNum.Value;
                }
                else
                {
                    //row.SetORDERNUMNull();
                }
                row.DOCUMENTNUM = entity.DocumentNum;
                row.F_YEAR = entity.K_Year;
                row.TYPENUM = entity.TypeNum;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static PageFileEntity RowToEntity(ArchiveMangeModal.PAGEFILERow row)
        {
            try
            {
                PageFileEntity entity = new PageFileEntity();
                entity.DataId = row.DATAID;
                entity.F_ArchiveId = row.F_ARCHIVEID;
                entity.ArchiveNum = row.ARCHIVENUM;
                entity.TempOrderNum = row.TEMPORDERNUM;
                entity.ArchiveSource = row.ARCHIVESOURCE;
                entity.FullFondsNum = row.FULLFONDSNUM;
                entity.Title = row.TITLE;
                if (!row.IsARCHIVETYPENull())
                {
                    entity.ArchiveType = row.ARCHIVETYPE;
                }
                entity.Publisher = row.PUBLISHER;
                if (!row.IsPUBLISHTIMENull())
                {
                    entity.PublishTime = row.PUBLISHTIME;
                }
                entity.FileOrgId = row.FILEORGID;
                entity.F_KeepTime = row.F_KEEPTIME;
                entity.F_CarrierType = row.F_CARRIERTYPE;
                entity.F_SecurityType = row.F_SECURITYTYPE;
                entity.F_KeepSecurityTime = row.F_KEEPSECURITYTIME;
                entity.PageNum = row.PAGENUM;
                entity.HuJianHao = row.HUJIANHAO;
                entity.BoxNum = row.BOXNUM;
                entity.ExpansionInfo = row.EXPANSIONINFO;
                if (!row.IsORDERNUMNull())
                {
                    entity.OrderNum = row.ORDERNUM;
                }
                entity.DocumentNum = row.DOCUMENTNUM;
                entity.K_Year = row.F_YEAR;
                entity.TypeNum = row.TYPENUM;
                return entity;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }

    public class EquipmentArchiveEntityHelper
    {
        public static void EntityToRow(EquipmentArchiveEntity entity, ArchiveMangeModal.EQUIPMENT_ARCHIVERow row)
        {
            try
            {
                row.DATAID = entity.DataId;
                row.ARCHIVENUM = entity.ArchiveNum;
                row.ARCHIVESOURCE = entity.ArchiveSource;
                row.FULLFONDSNUM = entity.FullFondsNum;
                row.TITLE = entity.Title;
                if (entity.ArchiveType.HasValue)
                {
                    row.ARCHIVETYPE = entity.ArchiveType.Value;
                }
                else
                {
                    row.SetARCHIVETYPENull();
                }
                if (entity.StartTime.HasValue)
                {
                    row.STARTTIME = entity.StartTime.Value;
                }
                else
                {
                    row.SetSTARTTIMENull();
                }
                if (entity.EndTime.HasValue)
                {
                    row.ENDTIME = entity.EndTime.Value;
                }
                row.PUBLISHORGID = entity.PublishOrgId;
                if (entity.FileTime.HasValue)
                {
                    row.FILETIME = entity.FileTime.Value;
                }
                else
                {
                    row.SetFILETIMENull();
                }
                row.FILEORGID = entity.FileOrgId;
                row.F_KEEPTIME = entity.F_KeepTime;
                row.F_CARRIERTYPE = entity.F_CarrierType;
                row.F_SECURITYTYPE = entity.F_SecurityType;
                if (entity.PageNum.HasValue)
                {
                    row.PAGENUM = entity.PageNum.Value;
                }
                else
                {
                    row.SetPAGENUMNull();
                }
                if (entity.FileNum.HasValue)
                {
                    row.FILENUM = entity.FileNum.Value;
                }
                else
                {
                    row.SetFILENUMNull();
                }
                if (entity.MainBodyNum.HasValue)
                {
                    row.MAINBODYNUM = entity.MainBodyNum.Value;
                }
                else
                {
                    row.SetMAINBODYNUMNull();
                }
                row.SUMMARY = entity.Summary;
                row.REMARK = entity.Remark;
                row.HUJIANHAO = entity.HuJianHao;
                row.STORAGETYPE = entity.StorageType;
                row.BOXNUM = entity.BoxNum;
                row.EXPANSIONINFO = entity.ExpansionInfo;
                row.TYPENUM = entity.TypeNum;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static EquipmentArchiveEntity RowToEntity(ArchiveMangeModal.EQUIPMENT_ARCHIVERow row)
        {
            try
            {
                EquipmentArchiveEntity entity = new EquipmentArchiveEntity();
                entity.DataId = row.DATAID;
                entity.ArchiveNum = row.ARCHIVENUM;
                entity.ArchiveSource = row.ARCHIVESOURCE;
                entity.FullFondsNum = row.FULLFONDSNUM;
                entity.Title = row.TITLE;
                if (!row.IsARCHIVETYPENull())
                {
                    entity.ArchiveType = row.ARCHIVETYPE;
                }
                if (!row.IsSTARTTIMENull())
                {
                    entity.StartTime = row.STARTTIME;
                }
                if (!row.IsENDTIMENull())
                {
                    entity.EndTime = row.ENDTIME;
                }

                entity.PublishOrgId = row.PUBLISHORGID;
                if (!row.IsFILETIMENull())
                {
                    entity.FileTime = row.FILETIME;
                }
                entity.FileOrgId = row.FILEORGID;
                entity.F_KeepTime = row.F_KEEPTIME;
                entity.F_CarrierType = row.F_CARRIERTYPE;
                entity.F_SecurityType = row.F_SECURITYTYPE;
                entity.F_KeepSecurityTime = row.F_KEEPSECURITYTIME;
                if (!row.IsPAGENUMNull())
                {
                    entity.PageNum = row.PAGENUM;
                }
                if (!row.IsFILENUMNull())
                {
                    entity.FileNum = row.FILENUM;
                }
                if (!row.IsMAINBODYNUMNull())
                {
                    entity.MainBodyNum = row.MAINBODYNUM;
                }
                entity.Remark = row.REMARK;
                entity.Summary = row.SUMMARY;
                entity.HuJianHao = row.HUJIANHAO;
                entity.StorageType = row.STORAGETYPE;
                entity.BoxNum = row.BOXNUM;
                entity.ExpansionInfo = row.EXPANSIONINFO;
                entity.TypeNum = row.TYPENUM;
                return entity;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }


    }

    public class DatasUpdateModel<T>
    {
        public List<T> InsertedRows { get; set; }
        public List<T> UpdatedRows { get; set; }
        public List<T> DeletedRows { get; set; }
    }

    public class DataBaseStringValueEscape
    {
        public void StringEscape(System.Data.DataRow row)
        {
            if (row == null)
            {
                return;
            }
            else
            {
                System.Data.DataTable table = row.Table;
                if (table != null)
                {
                    foreach (System.Data.DataColumn col in table.Columns)
                    {
                        if (col.DataType == typeof(string))
                        {
                            string tempString = row[col.ColumnName].ToString();
                            tempString = tempString.Replace("'", "''");
                            row[col.ColumnName] = tempString;
                        }
                    }
                }
            }
        }
    }


    //Author:Yidane
    //Date:2014年4月20日22:56:35
    //Edit:Guoyin
    //Date:2014年4月29日09:38:43
    public class DOCUMENT_ARCHIVE_VOLHelper
    {
        public static void EntityToRow(DOCUMENT_ARCHIVE_VOL entity, ArchiveMangeModal.DOCUMENT_ARCHIVE_VOLRow row)
        {
            row.ARCHIVENUM = entity.ArchiveNum;
            if (entity.ArchiveType.HasValue)
                row.ARCHIVETYPE = entity.ArchiveType.Value;
            row.AWARDTYPE = entity.AwardType;
            if (entity.Copies.HasValue)
                row.COPIES = entity.Copies.Value;
            row.DATAID = entity.DataId;
            row.DOCUMENTNUM = entity.DocumentNum;
            if (entity.EndTime.HasValue)
                row.ENDTIME = entity.EndTime.Value;
            row.F_CARRIERTYPE = entity.F_CarrierType;
            row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;
            row.F_KEEPTIME = entity.F_KeepTime;
            row.F_SECURITYTYPE = entity.F_SecurityType;
            row.FILEORGID = entity.FileOrgId;
            if (entity.FileTime.HasValue)
                row.FILETIME = entity.FileTime.Value;
            row.FILEUSER = entity.Fileuser;
            row.FULLFONDSNUM = entity.Fullfondsnum;
            if (entity.MainBodyNum.HasValue)
                row.MAINBODYNUM = entity.MainBodyNum.Value;
            if (entity.PageCou.HasValue)
                row.PEGECOU = entity.PageCou.Value;
            if (entity.RecordTime.HasValue)
                row.RECORDTIME = entity.RecordTime.Value;
            row.RECORDUSER = entity.RecordUser;
            row.REMARK = entity.Remark;
            row.RESPONSIBLEUSER = entity.ResponsibleUser;
            if (entity.StartTime.HasValue)
                row.STARTTIME = entity.StartTime.Value;
            row.SUMMARY = entity.Summary;
            row.TITLE = entity.Title;
            row.TIYAO = entity.Tiyao;
        }

        public static DOCUMENT_ARCHIVE_VOL RowToEntity(ArchiveMangeModal.DOCUMENT_ARCHIVE_VOLRow row)
        {
            return null;
        }
    }

    public class DOCUMENT_ARCHIVE_VOL_FileHelper
    {
        //Edit:Guoyin
        //Date:2014年4月29日09:40:59
        public static void EntityToRow(DOCUMENT_ARCHIVE_VOL_File entity, ArchiveMangeModal.DOCUMENT_ARCHIVE_VOL_FILERow row)
        {
            row.ARCHIVENUM = entity.ArchiveNum;
            if (entity.ArchiveType.HasValue)
                row.ARCHIVETYPE = entity.ArchiveType.Value;
            row.AWARDTYPE = entity.AwardType;
            if (entity.Copies.HasValue)
                row.COPIES = entity.Copies.Value;
            row.DATAID = entity.DataId;
            row.DOCUMENTNUM = entity.DocumentNum;
            if (entity.EndTime.HasValue)
                row.ENDTIME = entity.EndTime.Value;
            row.F_CARRIERTYPE = entity.F_CarrierType;
            row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;
            row.F_KEEPTIME = entity.F_KeepTime;
            row.F_SECURITYTYPE = entity.F_SecurityType;
            row.FILEORGID = entity.FileOrgId;
            if (entity.FileTime.HasValue)
                row.FILETIME = entity.FileTime.Value;
            row.FILEUSER = entity.Fileuser;
            row.FULLFONDSNUM = entity.Fullfondsnum;
            if (entity.MainBodyNum.HasValue)
                row.MAINBODYNUM = entity.MainBodyNum.Value;
            if (entity.PageCou.HasValue)
                row.PEGECOU = entity.PageCou.Value;
            if (entity.RecordTime.HasValue)
                row.RECORDTIME = entity.RecordTime.Value;
            row.RECORDUSER = entity.RecordUser;
            row.REMARK = entity.Remark;
            row.RESPONSIBLEUSER = entity.ResponsibleUser;
            if (entity.StartTime.HasValue)
                row.STARTTIME = entity.StartTime.Value;
            row.SUMMARY = entity.Summary;
            row.TITLE = entity.Title;
            row.TIYAO = entity.Tiyao;
        }

        public static DOCUMENT_ARCHIVE_VOL_File RowToEntity(ArchiveMangeModal.DOCUMENT_ARCHIVE_VOL_FILERow row)
        {
            return null;
        }
    }

    public class OLISEARCH_ZongHe_VOLHelper
    {
        public static void EntityToRow(OLISEARCH_ZongHe_VOL entity, ArchiveMangeModal.OLISEARCH_ZONGHE_VOLRow row)
        {
            row.ARCHIVENUM = entity.ArchiveNum;
            if (entity.ArchiveType.HasValue)
                row.ARCHIVETYPE = entity.ArchiveType.Value;
            row.AWARDTYPE = entity.AwardType;
            if (entity.Copies.HasValue)
                row.COPIES = entity.Copies.Value;
            row.DATAID = entity.DataId;
            row.DOCUMENTNUM = entity.DocumentNum;
            if (entity.EndTime.HasValue)
                row.ENDTIME = entity.EndTime.Value;
            row.F_CARRIERTYPE = entity.F_CarrierType;
            row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;
            row.F_KEEPTIME = entity.F_KeepTime;
            row.F_SECURITYTYPE = entity.F_SecurityType;
            row.FILEORGID = entity.FileOrgId;
            if (entity.FileTime.HasValue)
                row.FILETIME = entity.FileTime.Value;
            row.FILEUSER = entity.Fileuser;
            row.FULLFONDSNUM = entity.Fullfondsnum;
            if (entity.MainBodyNum.HasValue)
                row.MAINBODYNUM = entity.MainBodyNum.Value;
            if (entity.PageCou.HasValue)
                row.PEGECOU = entity.PageCou.Value;
            if (entity.RecordTime.HasValue)
                row.RECORDTIME = entity.RecordTime.Value;
            row.RECORDUSER = entity.RecordUser;
            row.REMARK = entity.Remark;
            row.RESPONSIBLEUSER = entity.ResponsibleUser;
            if (entity.StartTime.HasValue)
                row.STARTTIME = entity.StartTime.Value;
            row.SUMMARY = entity.Summary;
            row.TITLE = entity.Title;
            row.TIYAO = entity.Tiyao;
        }

        public static OLISEARCH_ZongHe_VOL RowToEntity(ArchiveMangeModal.OLISEARCH_ZONGHE_VOLRow row)
        {
            return null;
        }
    }

    public class OLISEARCH_ZongHe_VOL_FILEHelper
    {
        public static void EntityToRow(OLISEARCH_ZongHe_VOL_FILE entity, ArchiveMangeModal.OLISEARCH_ZONGHE_VOL_FILERow row)
        {
            row.ARCHIVENUM = entity.ArchiveNum;
            if (entity.ArchiveType.HasValue)
                row.ARCHIVETYPE = entity.ArchiveType.Value;
            row.AWARDTYPE = entity.AwardType;
            if (entity.Copies.HasValue)
                row.COPIES = entity.Copies.Value;
            row.DATAID = entity.DataId;
            row.DOCUMENTNUM = entity.DocumentNum;
            if (entity.EndTime.HasValue)
                row.ENDTIME = entity.EndTime.Value;
            row.F_CARRIERTYPE = entity.F_CarrierType;
            row.F_KEEPSECURITYTIME = entity.F_KeepSecurityTime;
            row.F_KEEPTIME = entity.F_KeepTime;
            row.F_SECURITYTYPE = entity.F_SecurityType;
            row.FILEORGID = entity.FileOrgId;
            if (entity.FileTime.HasValue)
                row.FILETIME = entity.FileTime.Value;
            row.FILEUSER = entity.Fileuser;
            row.FULLFONDSNUM = entity.Fullfondsnum;
            if (entity.MainBodyNum.HasValue)
                row.MAINBODYNUM = entity.MainBodyNum.Value;
            if (entity.PageCou.HasValue)
                row.PEGECOU = entity.PageCou.Value;
            if (entity.RecordTime.HasValue)
                row.RECORDTIME = entity.RecordTime.Value;
            row.RECORDUSER = entity.RecordUser;
            row.REMARK = entity.Remark;
            row.RESPONSIBLEUSER = entity.ResponsibleUser;
            if (entity.StartTime.HasValue)
                row.STARTTIME = entity.StartTime.Value;
            row.SUMMARY = entity.Summary;
            row.TITLE = entity.Title;
            row.TIYAO = entity.Tiyao;
        }

        public static OLISEARCH_ZongHe_VOL_FILE RowToEntity(ArchiveMangeModal.OLISEARCH_ZONGHE_VOL_FILERow row)
        {
            return null;
        }
    }
}
